<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>个人资料</title>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/layui/2.11.2/css/layui.min.css" rel="stylesheet">
    <style>
        .zl_li {
            list-style: none;
            position: relative;
            height: 50px;
            line-height: 50px;
            color: white;
        }

        .zl {
            width: 300px;
            height: 500px;
            padding: 0;
        }

        .er {
            position: absolute;
            right: 0;
            top: 0px;
        }

        .er>img {
            width: 50px;
            height: 50px;
        }

        .tc {
            width: 100%;
            height: 30px;
            border-radius: 10px;
            border: 0;
        }

        .tc:hover {
            cursor: pointer;
        }

        h1 {
            margin: 0;
            text-align: center;
        }

        .sousuo {
            margin-left: 20px;
            position: relative;
        }

        .sousuo>img {
            width: 20px;
            height: 20px;
            position: absolute;
            top: 20px;
            left: 3px;
            border-radius: 5px 0 0 5px;
        }

        #sou {
            width: 900px;
            height: 25px;
            border-radius: 50px;
            box-sizing: border-box;
            padding-left: 25px;
            border: 0;
        }

        .layui-side-scroll {
            background-color: #003f70;
        }

        .layui-nav-tree {
            background-color: #003f70;
        }

        #layui-header {
            background-color: #003f70;
        }

        .layui-card-header {
            background: url("https://c.53326.com/d/file/newpc202302/b0ci1sfofpz.jpg") no-repeat right/cover;
        }
    </style>
</head>

<body>

    <div class="layui-layout layui-layout-admin">
        <div class="layui-header" id="layui-header">
            <div class="layui-logo layui-hide-xs layui-bg-black" id="layui-bg-black">管理系统</div>
            <!-- 头部区域（可配合layui 已有的水平导航） -->
            <ul class="layui-nav layui-layout-left">
                <!-- 移动端显示 -->
                <li class="layui-nav-item layui-show-xs-inline-block layui-hide-sm" lay-header-event="menuLeft">
                    <i class="layui-icon layui-icon-spread-left"></i>
                </li>
                <!-- <li class="layui-nav-item layui-hide-xs"><a href="javascript:;">nav 1</a></li>
                <li class="layui-nav-item layui-hide-xs"><a href="javascript:;">nav 2</a></li>
                <li class="layui-nav-item layui-hide-xs"><a href="javascript:;">nav 3</a></li> -->
                <!-- 搜索 -->
                <li class="layui-nav-item">
                    <div class="sousuo">
                        <img src="https://ts1.tc.mm.bing.net/th/id/OIP-C.lpddQ7iAtQBY3ans1P7oVgHaHa?w=201&h=211&c=8&rs=1&qlt=90&o=6&dpr=1.3&pid=3.1&rm=2"
                            alt="">
                        <input type="text" name="" id="sou" placeholder="请输入内容">
                    </div>
                </li>
            </ul>
            <ul class="layui-nav layui-layout-right">
                <li class="layui-nav-item layui-hide layui-show-sm-inline-block">
                    <a href="javascript:;">
                        <!-- 头像 -->
                        <img src="" class="layui-nav-img">
                        <span class="yhname">1</span>
                    </a>
                    <!-- 头像旁边的下拉列表 -->
                    <dl class="layui-nav-child">
                        <dd> <a href="./个人资料.html">个人资料</a></dd>
                        <dd><a href="./商品列表.html">商品列表</a></dd>
                    </dl>
                </li>
            </ul>
        </div>
        <div class="layui-side layui-bg-black">
            <div class="layui-side-scroll">
                <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
                <ul class="layui-nav layui-nav-tree" lay-filter="test">
                    <li class="layui-nav-item layui-nav-itemed">
                        <a class="" href="./首页.html">商品数据</a>
                    </li>
                    <li class="layui-nav-item">
                        <a href="./商品列表.html">商品管理列表</a>
                    </li>
                    <li class="layui-nav-item" id="yi">
                        <a href="./个人资料.html">个人资料</a>
                    </li>
                    <li class="layui-nav-item">
                        <a href="./商品详情.html">商品详情</a>
                    </li>
                </ul>
            </div>
        </div>
        <div class="layui-body">
            <!-- 内容主体区域 -->
            <div style="padding: 15px;">
                <blockquote class="layui-elem-quote layui-text">
                    个人资料
                </blockquote>
                <div class="layui-card layui-panel">
                    <div class="layui-card-header">
                        <ul class="zl">
                            <li class="zl_li">
                                <span class="yi">头像</span>
                                <span class="er"></span>
                            </li>
                            <li class="zl_li">
                                <span class="yi">用户名</span>
                                <span class="er">2</span>
                            </li>
                            <li class="zl_li">
                                <span class="yi">手机号</span>
                                <span class="er">3</span>
                            </li>
                            <li class="zl_li">
                                <span class="yi">邮箱</span>
                                <span class="er">4 </span>
                            </li>
                            <li class="zl_li">
                                <button class="tc" onclick="exit()">退出登录</button><br>
                                <button class="tc" onclick="logout()">注销账号</button>
                            </li>
                        </ul>
                    </div>
                </div>
                <br><br>
            </div>
        </div>
    </div>
    <img src="" alt="">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/layui/2.11.2/layui.min.js"></script>
    <script src="https://code.jquery.com/jquery-3.7.1.js"></script>
    <script src=" https://cdn.jsdelivr.net/npm/echarts@5.6.0/dist/echarts.min.js "></script>
    <script type="text/javascript">
        $('document').ready(() => {
            $('#yi').css('background', '#16baaa')

        })
        //JS 
        layui.use(['element', 'layer', 'util'], function () {
            var element = layui.element;
            var layer = layui.layer;
            var util = layui.util;
            var $ = layui.$;

            //头部事件
            util.event('lay-header-event', {
                menuLeft: function (othis) { // 左侧菜单事件
                    layer.msg('展开左侧菜单的操作', { icon: 0 });
                },
            });
        });
        //用户名
        var shu = JSON.parse(localStorage.getItem('1'))
        $('.yhname').html(shu.name)
        //跳转
        function goods_list() {
            location.assign('./商品列表.html')
        }
        //退出登录
        function exit() {
            location.assign('./登录.html')
        }
        //注销
        function logout() {
            localStorage.removeItem('1')
            location.assign('./注册.html')
        }
        var tx1 = $('.er').eq(0)
        var tx2 = $('.er').eq(1)
        var tx3 = $('.er').eq(2)
        var tx4 = $('.er').eq(3)
        //修改
        var obj = {
            img: 'https://ts1.tc.mm.bing.net/th/id/OIP-C.Ko3rLErQKPke4WpPgvdBBAHaHa?w=210&h=211&c=8&rs=1&qlt=90&o=6&dpr=1.3&pid=3.1&rm=2',
            name: "qwe123",
            photo: "13846969456",
            email: "2645975468@qq.com",
        }
        localStorage.setItem('geren', JSON.stringify(obj))
        var yx = JSON.parse(localStorage.getItem('geren'))
        //头像
        $('.layui-nav-img')[0].src = `${yx.img}`

        tx1.html(`<img src="${yx.img}" alt="">`)
        tx2.html(yx.name)
        tx3.html(yx.photo)
        tx4.html(yx.email)
    </script>
</body>

</html>